// 用于注册components文件夹内部全部全局组件
import SvgIcon from './components/Svgicon.vue';
import Pagination  from './components/Pagination.vue';
//引入element-plus提供全部图标组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

console.log(ElementPlusIconsVue);


import type { App, Component } from 'vue';

//全局组件对象
const allGloablComponent:{ [name: string]: Component } = { SvgIcon , Pagination , };

export default {
    install(app: App) {
        Object.keys(allGloablComponent).forEach((key: string) => {
            app.component(key, allGloablComponent[key]);
        })
        //将element-plus提供图标注册为全局组件
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
            app.component(key, component)
        }
    }
}